#pragma once

//
// Allocate a matrix of size (m, n)
//
double** allocate_matrix(int m, int n);

//
// Free a matrix of size (m, n)
//
void free_matrix(double** M, int m, int n);

//
// Copy a matrix of size (m, n) to another matrix
//
double** copy_matrix(double** M, int m, int n);

//
// Returns the minor of the element (r, c) in the matrix M
//
void minor(double** M, int m, int n, int r, int c, double** minor);

//
// Compute the determinent of the matrix
//
double determinent(double** M, int m, int n);

// 
// Solve the linear system using the cramers rule
//
void solve_cramer(double** A, int m, int n, double** B, double** X);